<?php
require_once 'Command.php';
require_once 'database/GrosseryList.php';
require_once 'database/DatabaseConnection.php';

class CreateGrosseryListCommand implements Command{
	
	private $id;
	private $name;
	private $grosseryList;
	
	public function __construct($id, $name){
		$this->id = $id;
		$this->name = $name;
		$this->grosseryList = new GrosseryList();
	}
	
	public function execute(){
		DatabaseConnection::connect();
		$bool = $this->grosseryList->createGrosseryList($this->id, $this->name);
		DatabaseConnection::disconnect();
		$string = "<succes>".$bool."</succes>";
		return $string;;
	}
}